Skip to main content
Glama

长亭 IP 情报查询

长亭 IP 情报查询

Query IP addresses to retrieve threat intelligence including geolocation, ASN data, and historical malicious activity records for security analysis.

Instructions

基于长亭威胁情报,获取给定 IP 的威胁情报信息,包括 IP 地址、地理位置、ASN、历史恶意行为等信息

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
ipYes

Implementation Reference

  • Generic handler functions (handleXiaoBenYangApi and calcXiaoBenYangApi) that proxy tool calls to the remote API at https://mcp.xiaobenyang.com/api, adding toolName and mcpid, and formatting the response as MCP content.
    const calcXiaoBenYangApi = async function (fullArgs: Record<string, any>) {
        // 发起 POST 请求
        let response = await fetch('https://mcp.xiaobenyang.com/api', {
            method: 'POST',
            headers: {
                'XBY-APIKEY': apiKey,
                'func': fullArgs.toolName,
                'mcpid': mcpID
            },
            body: new URLSearchParams(fullArgs)
        });
        const apiResult = await response.text();
    
        return {
            content: [
                {
                    type: "text",
                    text: apiResult // 将字符串结果放入 content 中
                }
            ]
        } as { [x: string]: unknown; content: [{ type: "text"; text: string }] };
    };
    
    
    const handleXiaoBenYangApi = async (args: Record<string, any>, toolName: string) => {
        // 校验aid是否存在
        if (toolName === undefined || toolName === null) {
            throw new Error("缺少必要参数 'aid'");
        }
        // 合并参数
        const fullArgs = {...args, toolName: toolName};
        // 调用API
        return calcXiaoBenYangApi(fullArgs);
    };
  • Dynamically converts remote JSON schema (inputSchema) to Zod schema dictionary, mapping JSON types to Zod types and handling required/optional fields.
    let inputSchema = JSON.parse(apiDesc.inputSchema);
    const zodDict: Record<string, z.ZodTypeAny> = {};
    
    Object.entries(inputSchema.properties).forEach(([name, propConfig]) => {
        let zodType;
        let pt = (propConfig as { type: string }).type;
        switch (pt) {
            case 'string':
                zodType = z.string();
                break;
            case 'number':
                zodType = z.number();
                break;
            case 'boolean':
                zodType = z.boolean();
                break;
            case 'integer':
                zodType = z.int32();
                break;
            case 'array':
                zodType = z.array(z.any());
                break;
            case 'object':
                zodType = z.object(z.any());
                break;
            default:
                zodType = z.any();
        }
    
        if (inputSchema.required?.includes(name)) {
            zodDict[name] = zodType;
        } else {
            zodDict[name] = zodType.optional();
        }
    });
  • src/mcp.ts:89-133 (registration)
    Fetches tool list from https://mcp.xiaobenyang.com/getMcpDesc?mcpId=1777316659365891, parses each tool's inputSchema to Zod, and registers the tool (including "长亭 IP 情报查询") using the generic handler.
    for (const apiDesc of apiDescList) {
        let inputSchema = JSON.parse(apiDesc.inputSchema);
        const zodDict: Record<string, z.ZodTypeAny> = {};
    
        Object.entries(inputSchema.properties).forEach(([name, propConfig]) => {
            let zodType;
            let pt = (propConfig as { type: string }).type;
            switch (pt) {
                case 'string':
                    zodType = z.string();
                    break;
                case 'number':
                    zodType = z.number();
                    break;
                case 'boolean':
                    zodType = z.boolean();
                    break;
                case 'integer':
                    zodType = z.int32();
                    break;
                case 'array':
                    zodType = z.array(z.any());
                    break;
                case 'object':
                    zodType = z.object(z.any());
                    break;
                default:
                    zodType = z.any();
            }
    
            if (inputSchema.required?.includes(name)) {
                zodDict[name] = zodType;
            } else {
                zodDict[name] = zodType.optional();
            }
        });
    
    
        addToolXiaoBenYangApi(
            apiDesc.name,
            apiDesc.description ? apiDesc.description : apiDesc.name,
            zodDict);
    }
    isRegistered = true;
  • Helper function to register a tool with MCP server using the provided name, description, Zod input schema, and generic proxy handler.
    const addToolXiaoBenYangApi = function (
        name: string,
        desc: string,
        params: Record<string, ZodType>
    ) {
        server.registerTool(
            name,
            {
                title: name,
                description: desc,
                inputSchema: params,
            }
            ,
            async (args: Record<string, any>) => handleXiaoBenYangApi(args, name)
        )
    };
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden of behavioral disclosure. It states what information is returned (IP address, geographic location, ASN, historical malicious behavior) but doesn't describe other important behavioral traits: whether this is a read-only operation, rate limits, authentication requirements, error conditions, or response format. For a tool with zero annotation coverage, this leaves significant gaps in understanding how the tool behaves.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence that clearly states the tool's purpose and what information it returns. It's appropriately front-loaded with the core functionality. While very concise, it could potentially benefit from slightly more detail given the complete lack of annotations and output schema.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the complexity of threat intelligence queries and the complete lack of annotations (0% coverage) and no output schema, the description is insufficiently complete. It mentions what information is returned but doesn't describe the response structure, error handling, rate limits, or authentication requirements. For a tool that presumably queries external threat intelligence data, more context about behavioral expectations is needed.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema has 1 parameter with 0% description coverage (no schema descriptions). The tool description doesn't mention the 'ip' parameter at all, providing no additional semantic information beyond what's in the bare schema. However, with only one simple parameter, the baseline is appropriately 3 - the description doesn't add value but the simplicity of the schema means this isn't critically problematic.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's purpose: '获取给定 IP 的威胁情报信息' (get threat intelligence information for a given IP). It specifies the verb ('获取' - get/retrieve) and resource ('IP 的威胁情报信息' - IP threat intelligence information). However, since there are no sibling tools mentioned, it cannot demonstrate differentiation from alternatives, preventing a perfect score of 5.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies usage context by stating '基于长亭威胁情报' (based on Changting threat intelligence), suggesting this tool is specifically for querying that intelligence source. However, it provides no explicit guidance on when to use this tool versus alternatives (e.g., other IP lookup services), nor does it mention any prerequisites or exclusions. The guidance is implied rather than explicit.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/xiaobenyang-com/IP-Search'

If you have feedback or need assistance with the MCP directory API, please join our Discord server